-
Notifications
You must be signed in to change notification settings - Fork 240
Fix url key of createFileOutput options for streaming #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
u6516024155-coder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patrycja
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super aplikacja😘
|
I have just spend at least two hours trying to find out what I'm doing wrong, trying to write the output to a file. Besides the fact that @zeke Could you merge at least this part of the suggested change? Not sure about the other half and the types, but for the wrong call there is no workaround. Thanks! |
The file streaming API is hosted at https://stream.replicate.com/v1/files so we can use this prefix to determine that the response will contain file entities. This is far cleaner than relying on the event contents.
|
Thanks all for your contributions here. You're right this is a bug in the streaming logic. I've added some tests to verify the new behavior. Otherwise this looks great to me! |
97b292c to
5e03835
Compare
|
I will cut a new release shortly. |
Currently, if you try to stream files you get a FileOutput instance in the following state:
This is because a
{ data, fetch }object is passed tocreateFileOutput, which expects a{ url, fetch }object.I also noticed that FileOutput is always used for streaming, so I added the useFileOutput option to the
*streamfunction and set the value ofReplicate.useFileOutputas default.